<template>
  <div>
    <p id="pp">{{ msg }}</p>
    <button @click="msg = 'hello'">点我修改</button>
  </div>
</template>

<script>
export default {
  beforeCreate() {
    console.log('beforeCreate',this.msg);
  },
  created() {
    console.log('created', this.msg);
  },
  beforeMount() {
    const p = document.querySelector("#pp");
    console.log('beforeMount', p);
  },
  mounted() {
    const p = document.querySelector("#pp");
    console.log('mounted', p);
  },
  beforeUpdate() {
    const p = document.querySelector("#pp");
    console.log('beforeUpdate', p.innerHTML);
  },
  updated() {
    const p = document.querySelector("#pp");
    console.log('updated', p.innerHTML);
  },
  beforeDestroy(){
    console.log('beforeDestroy');
  },
  destroyed(){
    console.log('destroyed');

  },


  data() {
    return {
      msg: "你好世界",
    };
  },
};
</script>

<style lang="scss" scoped>
</style>